home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / dicehelp / dicehelp_cursor.ttx < prev    next >
Text File  |  1995-12-24  |  2KB  |  67 lines

  1. /*
  2. **      $Id: dicehelp_cursor.ttx,v 30.0 1994/06/10 18:05:49 dice Exp $
  3. **
  4. **      DICEHelp help system.  Script for Oxxi TurboText (tm).
  5. **
  6. **      Rexx script modeled after version by David Joiner
  7. */
  8. OPTIONS RESULTS
  9.                                             
  10. 'GETLINE'
  11. if (RC > 0) then do
  12.     exit
  13. end
  14. searchline = RESULT
  15.  
  16.  
  17. 'GETCURSORPOS'
  18. searchcol  = word( RESULT, 4 )
  19.  
  20.  
  21. hostname = address()            /* Source TTX window */
  22. portname = 'DICEHELP'           /* DICEHelp's port name */
  23. tempname = 't:DICEHelp.temp'    /* Temporary file for passing clips */
  24.  
  25. if ~show('p',portname) then do
  26.     address COMMAND 'RUN >NIL: <NIL: DICEHelp REXXSTARTUP'
  27.  
  28.     do i = 1 to 6
  29.         if ~show('p',portname) then do
  30.             address COMMAND 'wait 1'
  31.         end
  32.     end
  33.  
  34.     if ~show('p',portname) then do
  35.         'SetStatusBar "DICEHelp program not found!"'
  36.             exit
  37.     end
  38. end
  39.  
  40. address value portname
  41. Z searchcol searchline        /* Search for string: Z xx line */
  42. if RC=0 then do
  43.     refline   = RESULT
  44.         refstring = SUBWORD( refline, 2 )
  45.  
  46.     address value hostname           /* Back to TTX */
  47.         if WORD( refline, 1 ) = "E" then do
  48.                 'SetStatusBar' refstring
  49.                 exit
  50.     end
  51.  
  52.         OPENDOC NAME refstring
  53.     newport = RESULT        /* get the new editor's port name */
  54.     if RC > 0 then do        /* if not there, then error       */
  55.             'SetStatusBar' "Error opening" refstring
  56.         exit
  57.     end
  58.         address value newport           /* Address the new window */
  59.         SETREADONLY
  60.  
  61.     exit
  62. end
  63. else do
  64.     address value hostname
  65.     'SetStatusBar' "Error code" RC "DICEHelp failed!"
  66. end
  67.